<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "goods_attr_val".
 *
 * @property int $goods_id 商品id
 * @property string $goods_name 商品名称
 * @property string $attr_type 属性类型
 * @property int $attr_id 属性表
 * @property string $attr_name 属性名称
 * @property string $attr_val_id 属性值表ID
 */
class GoodsAttrVal extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'goods_attr_val';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['goods_id', 'attr_id', 'attr_val_id'], 'integer'],
            [['goods_name', 'attr_name'], 'required'],
            [['goods_name'], 'string', 'max' => 100],
            [['attr_type', 'attr_name'], 'string', 'max' => 30],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'goods_id' => 'Goods ID',
            'goods_name' => 'Goods Name',
            'attr_type' => 'Attr Type',
            'attr_id' => 'Attr ID',
            'attr_name' => 'Attr Name',
            'attr_val_id' => 'Attr Val ID',
        ];
    }
}
